package com.mxpio.erp.common.quality.service;

import com.mxpio.erp.common.inventory.entity.VInvLotStock;
import com.mxpio.erp.common.jpa.model.Order;
import com.mxpio.erp.common.quality.entity.UnqualifiedDisposal;
import com.mxpio.erp.common.quality.entity.UnqualifiedDisposalLine;
import com.mxpio.erp.common.vo.UnqualifiedDisposalAuditVO;
import com.mxpioframework.common.vo.Result;
import com.mxpioframework.jpa.query.Criteria;
import com.mxpioframework.system.service.BaseService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface UnqualifiedDisposalService extends BaseService<UnqualifiedDisposal> {

    Result<UnqualifiedDisposal> audit(UnqualifiedDisposalAuditVO auditVO);

    Result<UnqualifiedDisposal> saveWithCheck(UnqualifiedDisposal scrapOutApply);

    void handleRec(UnqualifiedDisposalLine line);

    @Transactional
    void handleRej(UnqualifiedDisposalLine line);

    @Transactional
    void handleRew(List<UnqualifiedDisposalLine> lines);

    @Transactional
    void handleScr(List<UnqualifiedDisposalLine> lines);

    @Transactional(readOnly = true)
    Page<VInvLotStock> lotPageUDUnRefer(Pageable pageAble, Criteria c);

    Result<? extends Order> submitOrder(String bizNo);

    @Transactional//需要拆批的
    void lotSplitByApplyDecision(UnqualifiedDisposalLine line);
}
